<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en-us" xml:lang="en-us">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="DC.Type" content="topic">
  <meta name="DC.Title" content="Step 2: Initializing sys_rman">
  <meta name="product" content="">
  <meta name="DC.Relation" scheme="URI" content="en-us_topic_0000002164620264.html">
  <meta name="prodname" content="">
  <meta name="version" content="">
  <meta name="brand" content="">
  <meta name="DC.Publisher" content="20250306">
  <meta name="prodname" content="csbs">
  <meta name="documenttype" content="usermanual">
  <meta name="DC.Format" content="XHTML">
  <meta name="DC.Identifier" content="EN-US_TOPIC_0000002164620328">
  <meta name="DC.Language" content="en-us">
  <link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
  <title>Step 2: Initializing sys_rman</title>
 </head>
 <body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px">
  <a name="EN-US_TOPIC_0000002164620328"></a><a name="EN-US_TOPIC_0000002164620328"></a>
  <h1 class="topictitle1">Step 2: Initializing sys_rman</h1>
  <div>
   <p>In the single-node system scenario of version 1.6.0, you must initialize the <strong>sys_rman</strong> configuration. In a cluster scenario, after upgrading the system from 1.5.0 to 1.6.0, or after the first backup or active/standby switchover following a restoration from a copy generated in 1.5.0, you must initialize the <strong>sys_rman</strong> configuration. Otherwise, backup and restoration cannot be performed.</p>
   <div class="section">
    <h4 class="sectiontitle">Procedure</h4>
    <p><strong>Single-node system initialization</strong></p>
    <ol>
     <li><span>Log in to the host where the Kingbase instance is located.</span></li>
     <li><span>Run the following command to check the installation directory and data directory of the Kingbase database:</span><p></p><pre class="screen">ps -ef | grep kingbase</pre> <p>The following figure shows the command output.</p> <p><span><img src="en-us_image_0000002200021113.png"></span></p> <p></p></li>
     <li><span>Run the following commands to modify the <strong>kingbase.conf</strong> file. Replace the data directory and installation directory in the subsequent operations with the actual ones.</span><p></p><pre class="screen">vi <em>/</em><em>Data directory</em>/kingbase.conf
archive_mode = on
archive_command = ''</pre> <p></p></li>
     <li><span>Run the following commands to reload the Kingbase configuration. <em>kingbase</em> indicates the name of the database installation user.</span><p></p><pre class="screen">su - <em>kingbase</em>
<em>/</em><em>Installation directory</em>/Server/bin/sys_ctl reload -D <em>/</em><em>Data directory</em>
exit</pre> <p></p></li>
     <li><span>Run the following commands to configure the node IP address, database installation directory, and data directory in the <strong>bin/sys_backup.conf</strong> file:</span><p></p><pre class="screen">cp <em>/</em><em>Installation directory</em>/share/sys_backup.conf <em>/</em><em>Installation directory</em>/Server/bin/sys_backup.conf
cd <em>/</em><em>Installation directory</em>/Server/bin
vi sys_backup.conf
_target_db_style="single"
_one_db_ip="<em>IP address of the current node</em>"
_repo_ip="<em>IP address of the current node</em>"
_single_data_dir="/<em>Data directory</em>"
_single_bin_dir="/<em>Installation directory</em>/Server/bin"</pre> <p></p></li>
     <li id="EN-US_TOPIC_0000002164620328__li524213216920"><a name="EN-US_TOPIC_0000002164620328__li524213216920"></a><a name="li524213216920"></a><span>Run the following commands to decompress the <strong>securecmdd</strong> file:</span><p></p><pre class="screen">su - kingbase
cd <em>/</em><em>Installation directory</em>/ClientTools/guitools/DeployTools/zip/
unzip securecmdd.zip</pre>
      <div class="note">
       <img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span>
       <div class="notebody">
        <p>If the database version is V8R6C7 or V8R6C8, perform <a href="#EN-US_TOPIC_0000002164620328__li524213216920">6</a> to <a href="#EN-US_TOPIC_0000002164620328__li31211317446">7</a>. Otherwise, skip these two steps.</p>
       </div>
      </div> <p></p></li>
     <li id="EN-US_TOPIC_0000002164620328__li31211317446"><a name="EN-US_TOPIC_0000002164620328__li31211317446"></a><a name="li31211317446"></a><span>Run the following commands as user <strong>root</strong> to enable the <strong>securecmdd</strong> file:</span><p></p><pre class="screen">cd <em>/</em><em>Installation directory</em>/ClientTools/guitools/DeployTools/zip/securecmdd/bin/
sh sys_HAscmdd.sh init
sh sys_HAscmdd.sh start</pre> <p></p></li>
     <li><span>Run the following commands to complete the initialization. <em>kingbase</em> indicates the name of the database installation user.</span><p></p><pre class="screen">su - <em>kingbase</em>
cd <em>/</em><em>Installation directory</em>/Server/bin
./sys_backup.sh init</pre> <p></p></li>
    </ol>
    <p><strong>Cluster initialization</strong></p>
    <ol>
     <li><span>Log in to the host where the Kingbase instance is located.</span></li>
     <li><span>Run the following command to check the installation directory and data directory of the Kingbase database:</span><p></p><pre class="screen">ps -ef | grep kingbase</pre> <p>The following figure shows the command output.</p> <p><span><img src="en-us_image_0000002164780076.png"></span></p> <p></p></li>
     <li><span>Run the following commands to modify the <strong>kingbase.conf</strong> file on the active/standby node:</span><p></p><pre class="screen">vi /<em>Data directory</em>/kingbase.conf
archive_mode = on
archive_command=''</pre> <p></p></li>
     <li><span>Run the following commands to reload the Kingbase configuration. <em>kingbase</em> indicates the name of the database installation user.</span><p></p><pre class="screen">su - <em>kingbase</em>
<em>/</em><em>Installation directory</em>/Server/bin/sys_ctl reload -D <em>/</em><em>Data directory</em>
exit</pre> <p></p></li>
     <li><span>Run the following commands to configure the node IP address, database installation directory, and data directory in the <strong>bin/sys_backup.conf</strong> on the active and standby nodes:</span><p></p><pre class="screen">cp <em>/</em><em>Installation directory</em>/share/sys_backup.conf /<em>Installation directory</em>/Server/bin/sys_backup.conf
cd <em>/</em><em>Installation directory</em>/Server/bin
vi sys_backup.conf
_target_db_style="cluster"
_one_db_ip="<em>IP address of the current node</em>" 
_repo_ip="<em>IP address of the current node</em>"
_single_data_dir="/<em>Data directory</em>"
_single_bin_dir="/<em>Installation directory</em>/Server/bin"
_use_scmd=off</pre>
      <div class="note">
       <img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span>
       <div class="notebody">
        <p>Steps 1 to 5 must be performed on both the active and standby nodes.</p>
       </div>
      </div> <p></p></li>
     <li><span>Run the following commands on the repo node to complete the initialization. <em>kingbase</em> indicates the name of the database installation user.</span><p></p><pre class="screen">su - <em>kingbase</em>
cd <em>/</em><em>Installation directory</em>/Server/bin
./sys_backup.sh init</pre>
      <div class="note">
       <img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span>
       <div class="notebody">
        <p>Step 6 must be performed on the active node.</p>
       </div>
      </div> <p></p></li>
    </ol>
   </div>
  </div>
  <div>
   <div class="familylinks">
    <div class="parentlink">
     <strong>Parent topic:</strong> <a href="en-us_topic_0000002164620264.html">Backing Up a Kingbase Instance</a>
    </div>
   </div>
  </div>
 </body>
</html>